package com.serviceprovider.business.module.admin.bonus.model;

//~--- JDK imports ------------------------------------------------------------

import java.util.List;

public class BonusCalculationResult {
    private Double                             actualAmount;
    private Double                             calculatedAmount;
    private List<BonusCalculationResultDetail> details;
    private Double                             unpaidBalance;

    public Double getActualAmount() {
        return actualAmount;
    }

    public void setActualAmount(Double actualAmount) {
        this.actualAmount = actualAmount;
    }

    public Double getCalculatedAmount() {
        return calculatedAmount;
    }

    public void setCalculatedAmount(Double calculatedAmount) {
        this.calculatedAmount = calculatedAmount;
    }

    public Double getUnpaidBalance() {
        return unpaidBalance;
    }

    public void setUnpaidBalance(Double unpaidBalance) {
        this.unpaidBalance = unpaidBalance;
    }

    public List<BonusCalculationResultDetail> getDetails() {
        return details;
    }

    public void setDetails(List<BonusCalculationResultDetail> details) {
        this.details = details;
    }

    @Override
    public boolean equals(Object obj) {
        if ((obj == null) ||!(obj instanceof BonusCalculationResult)) {
            return false;
        }

        BonusCalculationResult b  = (BonusCalculationResult) obj;
        boolean                eq = ((details == null) && (b.details == null)) || ((details != null) && details.equals(b.details));

        if (!eq) {
            return false;
        }

        eq = ((actualAmount == null) && (b.actualAmount == null))
             || ((actualAmount != null) && actualAmount.equals(b.actualAmount));

        if (!eq) {
            return false;
        }

        eq = ((calculatedAmount == null) && (b.calculatedAmount == null))
             || ((calculatedAmount != null) && calculatedAmount.equals(b.calculatedAmount));

        if (!eq) {
            return false;
        }

        eq = ((unpaidBalance == null) && (b.unpaidBalance == null))
             || ((unpaidBalance != null) && unpaidBalance.equals(b.unpaidBalance));

        if (!eq) {
            return false;
        }

        return true;
    }

    @Override
    public int hashCode() {
        int prime  = 31;
        int result = 1;

        result = prime * result + ((details == null)
                                   ? 0
                                   : details.hashCode());
        result = prime * result + ((actualAmount == null)
                                   ? 0
                                   : actualAmount.hashCode());
        result = prime * result + ((calculatedAmount == null)
                                   ? 0
                                   : calculatedAmount.hashCode());
        result = prime * result + ((unpaidBalance == null)
                                   ? 0
                                   : unpaidBalance.hashCode());

        return result;
    }
}



